package com.fsnbigdata.exception;


import com.fsnbigdata.enums.ResultEnum;

/**
 * @Description 参数异常统一处理
 * @Author zhao qian
 * @Date 2018/12/12 9:45
 **/
public class ParamException extends RuntimeException{

    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public ParamException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public ParamException(Integer code, String message) {

        this.code = code;
        this.message = message;
    }


}
